﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcs.Web.Admin
{
    public partial class left : Web.Admin.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                addNodes();
            }
        }

        private void addNodes()
        {
            TreeNode node_1_1 = new TreeNode();
            node_1_1.Text = "文章管理";
            node_1_1.NavigateUrl = "newsinfo/List.aspx";
            node_1_1.Target = "mainFrame";
            node_1_1.SelectAction = TreeNodeSelectAction.SelectExpand;
            //TreeNode node_1_2 = new TreeNode();
            //node_1_2.Text = "仓库管理";
            //node_1_2.NavigateUrl = "storeinfo/List.aspx";
            //node_1_2.Target = "mainFrame";
            //node_1_2.SelectAction = TreeNodeSelectAction.SelectExpand;
            //TreeNode node_1_3 = new TreeNode();
            //node_1_3.Text = "仓位类型管理";
            //node_1_3.NavigateUrl = "sptype/List.aspx";
            //node_1_3.Target = "mainFrame";
            //node_1_3.SelectAction = TreeNodeSelectAction.SelectExpand;
            //TreeNode node_1_4 = new TreeNode();
            //node_1_4.Text = "仓位管理";
            //node_1_4.NavigateUrl = "spaceinfo/List.aspx";
            //node_1_4.Target = "mainFrame";
            //node_1_4.SelectAction = TreeNodeSelectAction.SelectExpand; 
            this.TreeView1.Nodes.Add(node_1_1);
            //this.TreeView1.Nodes.Add(node_1_2);
            //this.TreeView1.Nodes.Add(node_1_3);
            //this.TreeView1.Nodes.Add(node_1_4);
            //TreeNode node_2_5 = new TreeNode();
            //node_2_5.Text = "到货确认";
            //node_2_5.NavigateUrl = "distribution/mystorelist.aspx";
            //node_2_5.Target = "mainFrame";
            //node_2_5.SelectAction = TreeNodeSelectAction.SelectExpand;
            //TreeNode node_2_1 = new TreeNode();
            //node_2_1.Text = "入库请求";
            //node_2_1.NavigateUrl = "showin.aspx";
            //node_2_1.Target = "mainFrame";
            //node_2_1.SelectAction = TreeNodeSelectAction.SelectExpand;

            //TreeNode node_2_2 = new TreeNode();
            //node_2_2.Text = "库存";
            //node_2_2.NavigateUrl = "inventory/list.aspx";
            //node_2_2.Target = "mainFrame";
            //node_2_2.SelectAction = TreeNodeSelectAction.SelectExpand;

            //TreeNode node_2_3 = new TreeNode();
            //node_2_3.Text = "入库记录";
            //node_2_3.NavigateUrl = "instore/list.aspx";
            //node_2_3.Target = "mainFrame";
            //node_2_3.SelectAction = TreeNodeSelectAction.SelectExpand;


            //TreeNode node_2_4 = new TreeNode();
            //node_2_4.Text = "手动入库";
            //node_2_4.NavigateUrl = "materialinfo/add.aspx";
            //node_2_4.Target = "mainFrame";
            //node_2_4.SelectAction = TreeNodeSelectAction.SelectExpand;


            //TreeNode node_2_31 = new TreeNode();
            //node_2_31.Text = "仓位调整";
            //node_2_31.NavigateUrl = "spaceinfo/adjust.aspx";
            //node_2_31.Target = "mainFrame";
            //node_2_31.SelectAction = TreeNodeSelectAction.SelectExpand;
           
            //TreeView2.Nodes.Add(node_2_1);
            //TreeView2.Nodes.Add(node_2_4);
            //TreeView2.Nodes.Add(node_2_31);
            //TreeView2.Nodes.Add(node_2_2);
            //TreeView2.Nodes.Add(node_2_3);            
        }

        protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
        {
            TreeView t = sender as TreeView;
            if (t != null)
            {
                for (int i = 0; i < t.Nodes.Count; i++)
                {
                    if (t.SelectedNode.Value == t.Nodes[i].Value)
                    {
                        if (t.SelectedNode.Expanded != null)
                            t.SelectedNode.Expanded = !t.SelectedNode.Expanded;
                        else
                            t.SelectedNode.Expanded = true;
                    }
                }
            }

        }

       
    }
}